//
//  UserModel.m
//  MiniWeChat
//
//  Created by ByteDance on 2025/6/24.
//

#import "UserModel.h"

@implementation UserModel

- (void)encodeWithCoder:(NSCoder *)coder {
    [coder encodeObject:self.id forKey:@"id"];
    [coder encodeObject:self.nickname forKey:@"nickname"];
    [coder encodeObject:self.avatar forKey:@"avatar"];
    [coder encodeObject:self.phone forKey:@"phone"];
    [coder encodeInteger:self.gender forKey:@"gender"];
    [coder encodeObject:self.signature forKey:@"signature"];
    [coder encodeObject:self.extra forKey:@"extra"];
}

- (instancetype)initWithCoder:(NSCoder *)coder {
    self = [super init];
    if (self) {
        self.id = [coder decodeObjectForKey:@"id"];
        self.nickname = [coder decodeObjectForKey:@"nickname"];
        self.avatar = [coder decodeObjectForKey:@"avatar"];
        self.phone = [coder decodeObjectForKey:@"phone"];
        self.gender = [coder decodeIntegerForKey:@"gender"];
        self.signature = [coder decodeObjectForKey:@"signature"];
        self.extra = [coder decodeObjectForKey:@"extra"];
    }
    return self;
}

@end
